#pragma once
#include "DRandom.h"
#include "DVector3.h"
#include "DVector4.h"
#include "DQuaternion.h"
#include "DMatrix3.h"
#include "DMatrix4.h"

namespace Skill
{
	namespace Ode
	{
		bool DRandom::TestRand()
		{
			return (dTestRand() == 1) ? true : false;
		}
		unsigned long DRandom::GetRandom()
		{
			return dRand();
		}

		unsigned long DRandom::Seed::get()
		{
			return dRandGetSeed();
		}
		void DRandom::Seed::set(unsigned long value)
		{
			dRandSetSeed(value);
		}

		int DRandom::GetRandInt(int n)
		{
			return dRandInt(n);
		}
		dReal DRandom::GetRandReal()
		{
			return dRandReal();
		}
		void DRandom::MakeRandomVector(DVector3^ A, dReal range)
		{
			dMakeRandomVector(A->_This,3, range);
		}
		void DRandom::MakeRandomVector(DVector4^ A, dReal range)
		{
			dMakeRandomVector(A->_This,4, range);
		}
		void DRandom::MakeRandomQuaternion(DQuaternion^ A, dReal range)
		{
			dMakeRandomVector(A->_This,4, range);
		}
		void DRandom::MakeRandomMatrix(DMatrix3^ A, dReal range)
		{
			dMakeRandomMatrix(A->_This,4,3, range);
		}
		void DRandom::MakeRandomMatrix(DMatrix4^ A, dReal range)
		{
			dMakeRandomMatrix(A->_This,4,4, range);
		}

		void DRandom::ClearUpperTriangle(DMatrix4^ A)
		{
			dClearUpperTriangle(A->_This,16);
		}

		dReal DRandom::GetMaxDifference(DMatrix4^ A, DMatrix4^ B)
		{
			return dMaxDifference(A->_This, B->_This,4,4);
		}
		dReal DRandom::GetMaxDifference(DMatrix3^ A, DMatrix3^ B)
		{
			return dMaxDifference(A->_This, B->_This,4,3);
		}

		dReal DRandom::GetMaxDifferenceLowerTriangle(DMatrix4^ A, DMatrix4^ B)
		{
			return dMaxDifferenceLowerTriangle(A->_This, B->_This,4);
		}
	}
}